import {
  createRouter,
  createWebHashHistory,
  type RouteLocationNormalized,
} from 'vue-router'
import routes from './routes'
const router = createRouter({
  // hash路由模式
  history: createWebHashHistory(),
  // History路由模式
  // history: createWebHistory(),
  routes
})

export interface toRouteType extends RouteLocationNormalized {
  meta: {
    title?: string
    noCache?: boolean
  }
}
router.beforeEach((_to: toRouteType, _from, next) => {
  next()
})
router.afterEach(() => {})
export default router
